package com.it.controller;


import com.it.service.IAnswerRecordService;
import com.it.util.Result;
import com.it.util.ThreadLocalUtil;
import com.it.vo.AnswerRecordVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-09-26
 */
@RestController
@RequestMapping("/answerRecord")
public class AnswerRecordController {
    @Resource
    IAnswerRecordService answerRecordService;

    @GetMapping("/answerRecordList")
     Result answerRecordList(){
        Long userID=ThreadLocalUtil.getUserId();
        List<AnswerRecordVo> records = answerRecordService.getAnswerRecordsByUserId(userID);
        return Result.success(records);
    }
}
